﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace LinxDtefTelas
{
    public class LogFile
    {
        private string fileName;
        public LogFile()
        {
            fileName = "L:\\LinxPOS\\Log\\LinxDTEFRetorno.txt";
        }
        public LogFile(string fileName)
        {
            this.fileName = fileName;
        }

     
        public void saveLogLinxDTEF(string strFunction, string strMessageLog)
        {
            using (StreamWriter writer = new StreamWriter(new FileStream(fileName, FileMode.Append)))
            {
                if (strFunction == string.Empty || strFunction == null)
                {
                    writer.WriteLine("\r\n-----------------------------------------------------------");
                    writer.WriteLine("Iniciando a gravação de LOG : " + DateTime.Now.ToLongTimeString());
                }
                else
                {
                    writer.WriteLine("{0}", strFunction);
                    writer.WriteLine("Mensagem de retorno da transação: {0}", strMessageLog);

                }
               
            }
        }
    }
}
